<?
  class Application_Model_WhiteLabels extends Zend_Db_Table_Abstract
  {
    protected $_name = "white_labels";
	protected $_rowClass = "WhiteLabel";

	public function findByHash($hash)
	{
	  $idData = Jeppii_Token_Int::decodeArray($hash);

	  return $this->fetchRow($this->select()->where('id = ?', (int)$idData[0]));
	}
  }

  class WhiteLabel extends Zend_Db_Table_Row
  {
    public function getHash()
	{
	  return Jeppii_Token_Int::encodeArray(array($this->id, 111111*$this->id));
	}
  }
